package com.qzsoft.zhjd.warning.modules.warningasphaltconfig.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qzsoft.zhjd.warning.modules.warningasphaltconfig.entity.WarningAsphaltUserEntity;
import com.qzsoft.zhjd.warning.modules.warningasphaltconfig.mapper.WarningAsphaltUserMapper;
import com.qzsoft.zhjd.warning.modules.warningasphaltconfig.service.WarningAsphaltUserService;

/**
 * @ClassName WarningAsphaltServiceImpl
 * @Description 沥青预警业务接口实现
 * @author linhuawei
 * @since 2022-05-16
 */
@Service
public class WarningAsphaltUserServiceImpl extends ServiceImpl<WarningAsphaltUserMapper, WarningAsphaltUserEntity>
        implements WarningAsphaltUserService {

    @Override
    public List<WarningAsphaltUserEntity> listByConfigId(String configId) {
        QueryWrapper<WarningAsphaltUserEntity> queryWrapper = new QueryWrapper<WarningAsphaltUserEntity>();
        queryWrapper.eq("config_id", configId);
        queryWrapper.orderByAsc("name");
        return baseMapper.selectList(queryWrapper);
    }

    @Override
    public void deleteByConfigId(Serializable configId) {
        QueryWrapper<WarningAsphaltUserEntity> queryWrapper = new QueryWrapper<WarningAsphaltUserEntity>();
        queryWrapper.eq("config_id", configId);
        baseMapper.delete(queryWrapper);
    }

}
